package com.gh.cloud.zuul.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: guohao
 * @date: 2021-02-05 16:29
 **/
@RequestMapping(value = "/config")
@RestController
@RefreshScope
public class ConfigController {

    @Value("${user.name}")
    private String name;

    @Value("${user.age:10}")
    private String age;
    @Value("${test:null}")
    private String test;

    @RequestMapping("/get")
    public String get() {

        return name+"----"+age+"--------"+test;
    }
}
